<template>
    <div class="ListItem" @click="$emit('click')">
        <div class="left">
            <img src="../../../assets/logo.png" alt="">
            <div>
                <span class="name">小猪</span>
                <span v-if="type===0" class="count">成交量 <span class="DIN-Medium">2130</span></span>
                <div class="payTypes">
                    <gy-icon fontName="icon-zhifubao" style="color: #02A9F0;"></gy-icon>
                    <gy-icon fontName="icon-weixin1" style="color: #52BD33;"></gy-icon>
                    <gy-icon fontName="icon-yinhangqia" style="color:#118CE8;"></gy-icon>
                </div>
            </div>
        </div>
        <div class="right">
            <span class="time DIN-Medium">2019-09-09 12:12:34</span>
            <p class="count"><strong class="DIN-Medium">17870</strong> <span> {{type===0 ? ' 剩余' : '已购'}}</span></p>
            <p class="count"><strong class="DIN-Medium">20000</strong> <span> {{type === 0 ? '总量' : '收购'}}</span></p>
        </div>
    </div>
</template>

<script lang="ts">
    import {Component, Vue, Prop} from 'vue-property-decorator'
    import GyIcon from "../../../components/GyIcon.vue";

    @Component({
        name: 'ListItem',
        components: {GyIcon}
    })
    export default class extends Vue {
        @Prop()
        private type!: number;
    }
</script>

<style scoped lang="less">
    .ListItem {
        position: relative;
        overflow: hidden;
        user-select: none;
        &:after {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            z-index: 2;
        }
        &:active {
            &:after {
                background-color: rgba(0, 0, 0, .1);
            }
        }
        border-radius: 0.1rem;
        background-color: white;
        height: 2.20rem;
        width: 6.90rem;
        margin-top: 0.2rem;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.3rem;
        & .left {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: flex-start;
            & img {
                width: 0.8rem;
                height: 0.8rem;
                border-radius: 0.8rem;
            }
            & .name {
                display: block;
                font-size: 0.3rem;
                font-weight: 600;
                text-align: left;
                line-height: 0.6rem;
            }
            & .count {
                display: block;
                font-size: 0.24rem;
                color: #999999;
                text-align: left;
                line-height: 0.4rem;
            }
            & .payTypes {
                color: unset;
                font-size: 0.3rem;
                line-height: 0.6rem;
                & .iconfont {
                    margin-right: 0.1rem;
                }
            }
        }
        & .right {
            text-align: right;
            & .time {
                font-size: 0.24rem;
                line-height: 0.4rem;
            }
            & .count {
                color: #666666;
                font-size: 0.24rem;
                line-height: 0.6rem;
                & strong {
                    font-size: 0.36rem;
                }
            }
        }
    }
</style>
